package com.bdqn.util;

import java.util.Calendar;
import java.util.Date;

public class CalenUtil {
    private static Calendar calendar = Calendar.getInstance();

    public static int getWeek(Date date){
        calendar.setTime(date);
        if(calendar.get(Calendar.DAY_OF_WEEK)>=1){
            return calendar.get(Calendar.DAY_OF_WEEK);
        }else{
            return 0;
        }
    }

    public static int getHours(Date date){
        calendar.setTime(date);
        return calendar.get(Calendar.HOUR_OF_DAY);
    }

    public static int getMin(Date date){
        calendar.setTime(date);
        return calendar.get(Calendar.MINUTE);
    }
}
